package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallAd;
import com.appkubes.mall.core.po.MallAdExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallAdMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAdSqlProvider.class, method="countByExample")
    long countByExample(MallAdExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallAdSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallAdExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_ad",
        "where ad_key = #{adKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String adKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_ad (ad_key, app_key, ",
        "title, `path`, param, ",
        "pic, sort, create_time, ",
        "update_time, `type`, ",
        "memo, `state`, link_type, ",
        "appid, version)",
        "values (#{adKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{title,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{param,jdbcType=VARCHAR}, ",
        "#{pic,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, ",
        "#{memo,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{linkType,jdbcType=INTEGER}, ",
        "#{appid,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallAd record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallAdSqlProvider.class, method="insertSelective")
    int insertSelective(MallAd record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAdSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ad_key", property="adKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="path", property="path", jdbcType=JdbcType.VARCHAR),
        @Result(column="param", property="param", jdbcType=JdbcType.VARCHAR),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="memo", property="memo", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="link_type", property="linkType", jdbcType=JdbcType.INTEGER),
        @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallAd> selectByExampleWithRowbounds(MallAdExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAdSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ad_key", property="adKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="path", property="path", jdbcType=JdbcType.VARCHAR),
        @Result(column="param", property="param", jdbcType=JdbcType.VARCHAR),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="memo", property="memo", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="link_type", property="linkType", jdbcType=JdbcType.INTEGER),
        @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallAd> selectByExample(MallAdExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "ad_key, app_key, title, `path`, param, pic, sort, create_time, update_time, ",
        "`type`, memo, `state`, link_type, appid, version",
        "from mall_ad",
        "where ad_key = #{adKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="ad_key", property="adKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="path", property="path", jdbcType=JdbcType.VARCHAR),
        @Result(column="param", property="param", jdbcType=JdbcType.VARCHAR),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="memo", property="memo", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="link_type", property="linkType", jdbcType=JdbcType.INTEGER),
        @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallAd selectByPrimaryKey(String adKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAdSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallAd record, @Param("example") MallAdExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAdSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallAd record, @Param("example") MallAdExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAdSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallAd record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_ad
     *
     * @mbg.generated
     */
    @Update({
        "update mall_ad",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "title = #{title,jdbcType=VARCHAR},",
          "`path` = #{path,jdbcType=VARCHAR},",
          "param = #{param,jdbcType=VARCHAR},",
          "pic = #{pic,jdbcType=VARCHAR},",
          "sort = #{sort,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "`type` = #{type,jdbcType=INTEGER},",
          "memo = #{memo,jdbcType=VARCHAR},",
          "`state` = #{state,jdbcType=INTEGER},",
          "link_type = #{linkType,jdbcType=INTEGER},",
          "appid = #{appid,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where ad_key = #{adKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallAd record);
}